<?php

namespace core\lib;

class LibCache
{
    public static function getCache()
    {
        return \Yii::$app->cache;
    }

    public static function get($key, $isGlobal = false){
        return self::getCache()->get(LibApplicant::getKey($key, $isGlobal));
    }

    public static function set($key, $value, $duration = 0, $isGlobal = false){
        self::getCache()->set(LibApplicant::getKey($key, $isGlobal), $value, $duration);
    }

    public static function flush(){
        self::getCache()->flush();
    }

    public static function delete($key, $isGlobal = false){
        self::getCache()->delete(LibApplicant::getKey($key, $isGlobal));
    }
}
